home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / mail / mmdf / mmdf-IIb.43 / src / shellfiles / makemailids.sh < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  1986-02-01  |  448 b   |  25 lines

  1. #! /bin/sh
  2. #
  3. #    makemailids.sh
  4. #
  5. #    Generates the mailids and users files from /etc/passwd.
  6. #    /etc/passwd is expected to contain an "<mailid>" entry in
  7. #    the GCOS field.  This field may eventually contain more than
  8. #    one mailid.
  9. #
  10. PATH=/bin:/usr/bin:.
  11.  
  12. ed - /etc/passwd <<DONE
  13. v/</d
  14. g/:.*</s//    /
  15. g/>.*/s///
  16. w users.new
  17. g/\(.*\)    \(.*\)/s//\2    \1/
  18. w mailids.new
  19. q
  20. DONE
  21. mv users users.bak
  22. mv users.new users
  23. mv mailids mailids.bak
  24. mv mailids.new mailids
  25.